<template>
  <div>
    <!-- 搜索容器 -->
    <div class="search-container">
      <span class="search-label">职位：</span>
      <el-input v-model="input" placeholder="搜索职位" class="search-input"></el-input>

      <el-button type="primary" class="search-button">查询</el-button>
      <el-button type="success" class="search-button">重置</el-button>
      <el-button type="success" class="search-button">添加职位</el-button>
    </div>

    <el-table :data="tableData" border style="width: 100%; margin-top: 15px;" 
      :header-cell-style="{ textAlign: 'center' }"
      :cell-style="{ textAlign: 'center' }">
      <!-- 第一列：行业 -->
      <el-table-column prop="industry" label="行业"></el-table-column>
      
      <!-- 第二列：职位 -->
      <el-table-column prop="position" label="职位"></el-table-column>
      
      <!-- 第三列：职位简介 -->
      <el-table-column prop="description" label="职位简介"></el-table-column>
      
      <!-- 第四列：职位操作 -->
      <el-table-column label="职位操作" width="260">
        <template slot-scope="scope">
          <el-button @click="handleEdit(scope.row)" type="text" size="small">修改职位</el-button>
          <el-button @click="handleDelete(scope.row)" type="text" size="small">删除职位</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 分页组件 -->
    <el-pagination class="pagination-left" background layout="prev, pager, next" :total="1000"></el-pagination>
  </div>
</template>

<script>
export default {
  methods: {
    handleEdit(row) {
      console.log('编辑', row);
    },
    handleDelete(row) {
      console.log('删除', row);
    },
    handleDetail(row) {
      console.log('详情', row);
    }
  },
  data() {
    return {
      input: '',
      tableData: [
        {
          industry: '互联网',
          position: '前端工程师',
          description: '负责Web前端开发，Vue/React框架使用'
        },
        {
          industry: '金融',
          position: '财务分析师',
          description: '负责公司财务数据分析与报告'
        },
        {
          industry: '教育',
          position: '课程顾问',
          description: '负责课程咨询与学员服务'
        },
        {
          industry: '医疗',
          position: '护士',
          description: '负责病人护理与医疗协助'
        }
      ]
    }
  }
}
</script>

<style>
/* 搜索容器样式 */
.search-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}

.search-label {
  white-space: nowrap;
  font-size: 14px;
  color: #606266;
}

.search-input {
  width: 200px;
}

.search-button {
  margin-left: 10px;
}

/* 表格样式 */
.el-table th {
  height: 70px !important;
  line-height: 70px !important;
}

.el-table {
  margin-top: 15px;
}

.el-table__header-wrapper th {
  background-color: #f5f7fa;
}

/* 分页样式 */
.pagination-left {
  margin-top: 15px;
  text-align: left;
}

/* 操作按钮间距 */
.el-table .el-button--text {
  margin: 0 5px;
}
</style>